<?php framework::view('index/header')?>
<script type="text/javascript">
function checklogin(){
	var url = '<?php echo HIGHPHP_WWW_HOST?>user/login';
	var username = $.trim($("#username").val());
	var pwd = $.trim($("#pwd").val());
	var checkcode = $.trim($("#checkcode").val());
    $.post(url,{'username':username,'pwd':pwd,'checkcode':checkcode},function(rs){
        if(rs=='成功'){
        	$("#msginfo").html(rs);
            window.location.href='<?php echo $tourl;?>';
        }else{
            $("#msginfo").html(rs);
        }
    })
}
</script>

<div class="loginact" style="width:100%;min-height: 400px;border-top: solid 2px #ff9900;">
<div style="" class="lrtab">

<a href="<?php echo HIGHPHP_WWW_HOST?>user/login" class="lrtabon" style="border-left: solid 1px #DFDFDF" >用户登录</a>
<a href="<?php echo HIGHPHP_WWW_HOST?>user/reg" >用户注册</a>
</div>
<div class="clear"></div>
<form onsubmit="checklogin();return false;">
<table style="width: 100%">
    <tr >
	    <td align="right" width="30%">&nbsp;</td><td width="230"  id="msginfo">
	    <td>&nbsp;</td></tr>
	<tr>
		<td align="right" width="30%">*帐号：</td><td width="230"><input type="text" value="" name="username" id="username" class="logintext"></td><td class="logintips">邮箱或手机号</td>
	</tr>
	<tr>
		<td align="right">登录密码：</td><td><input type="password"  name="pwd"  id="pwd" class="logintext"></td><td class="logintips">忘记密码？</td>
	</tr>
	
	
    <?php if ($ischeckcode){?>
	<tr><td align="right">验证码：</td>
		<td colspan="2"><input type="text" class="logintext_code" name="checkcode">
		<img src="<?php echo HIGHPHP_WWW_HOST.'captcha?t='.time()?>" onclick="
			    this.src='<?php echo HIGHPHP_WWW_HOST.'captcha'?>?t='+Math.random();" style="cursor: pointer;" title="点击更换"/>
		</td>
	</tr>
    <?php }else {
        echo '<tr style="display:none"><td colspan="3"><input type="text" class="logintext" name="checkcode" id="checkcode"></td></tr>';
    }?>
	<tr><td align="right">&nbsp;</td>
		<td><input type="submit" value="登录" class="loginbtn"></td><td class="logintips">&nbsp;</td>
	</tr>
</table>
</form>
</div>
<?php framework::view('index/footer')?>
<script type="text/javascript">$("#username").focus();</script>